<?php

declare(strict_types=1);
/**
 * This file is part of Hyperf.
 *
 * @link     https://www.hyperf.io
 * @document https://doc.hyperf.io
 * @contact  group@hyperf.io
 * @license  https://github.com/hyperf-cloud/hyperf/blob/master/LICENSE
 */

namespace App\Controller;

use Hyperf\HttpServer\Annotation\Middleware;
use App\Middleware\JTAuthMiddleware;
use App\Middleware\CorsMiddleware;
use App\Service\Coin\CheckOrderService;
use App\Service\Coin\CoinDetailListService;
use App\Service\Coin\CreateOrderService;
use App\Service\Coin\MyCoinService;
use App\Service\Coin\SubjectsSerice;
use Hyperf\HttpServer\Annotation\RequestMapping;
use Hyperf\HttpServer\Annotation\Controller;

/**
 * @Controller(prefix="coin")
 */
class CoinController extends AbstractController
{
    /**
     * 我的虚拟币账户
     * @RequestMapping(path="my_info", methods="post")
     * @Middleware(JTAuthMiddleware::class)
     */
    public function my_info(MyCoinService $service)
    {
        return $service->response();
    }

    /**
     * 商品设置
     * @RequestMapping(path="subjects", methods="post")
     * @Middleware(JTAuthMiddleware::class)
     */
    public function subjects(SubjectsSerice $service)
    {
        return $service->response();
    }

    /**
     * 充值创建订单
     * @RequestMapping(path="order/create", methods="post")
     * @Middleware(JTAuthMiddleware::class)
     */
    public function order_create(CreateOrderService $service)
    {
        return $service->response();
    }

    /**
     * 查询订单状态
     * @RequestMapping(path="order/check", methods="post")
     * @Middleware(JTAuthMiddleware::class)
     */
    public function order_check(CheckOrderService $service)
    {
        return $service->response();
    }

    /**
     * 我的收支明细
     * @RequestMapping(path="detail/list", methods="post")
     * @Middleware(JTAuthMiddleware::class)
     */
    public function detail_list(CoinDetailListService $service)
    {
        return $service->response();
    }
}
